<div bsModal #createOrEditModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="createOrEditModal"
    aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #editForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="order.id">编辑任务</span>
                        <span *ngIf="!order.id">创建新的任务</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>

                <div class="modal-body">
                    <!-- <div class="row">
                        <div class="col-md-6">
                            <label>任务系统id</label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="modelPlanSystemId" [ngClass]="{'edited': order.modelPlanSystemId}" [(ngModel)]="order.modelPlanSystemId">
                            </div>
                        </div>
                    </div> -->

                    <div class="row">
                        <div class="col-md-6">
                            <label>批次
                                <span class="text-danger">*</span>
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="batchString" [ngClass]="{'edited': order.batchString}" [(ngModel)]="order.batchString"
                                    required>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label>型号
                                <span class="text-danger">*</span>
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="modelCode" [ngClass]="{'edited': order.modelCode}" [(ngModel)]="order.modelCode" required>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-6">
                            <label>任务号
                                <span class="text-danger">*</span>
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="taskCode" [ngClass]="{'edited': order.taskCode}" [(ngModel)]="order.taskCode" required>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label>任务名称
                                <span class="text-danger">*</span>
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="taskName" [ngClass]="{'edited': order.taskName}" [(ngModel)]="order.taskName" required>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-6">
                            <label>图号
                                <span class="text-danger">*</span>
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="drawingCode" [ngClass]="{'edited': order.drawingCode}" [(ngModel)]="order.drawingCode"
                                    required>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label>部段名称
                                <span class="text-danger">*</span>
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="modelPartName" [ngClass]="{'edited': order.modelPartName}" [(ngModel)]="order.modelPartName"
                                    required>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-6">
                            <label>数量
                                <span class="text-danger">*</span>
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input type="number" min="1" class="form-control" name="amount" [ngClass]="{'edited': order.amount}" [(ngModel)]="order.totalQuantity"
                                    required>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label>单箭数量</label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input type="number" min="0" class="form-control" name="singleProductAmount" [ngClass]="{'edited': order.singleProductAmount}"
                                    [(ngModel)]="order.singleProductAmount">
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-6">
                            <label>完成时间
                                <span class="text-danger">*</span>
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <!-- <input #dueDatePicker name="dueDatePicker" class="form-control" [ngClass]="{'edited': order.dueDate}" [ngModel]="order.dueDate?(order.dueDate | momentFormat:'YYYY/MM/DD'): ''"  ng-minlength="1" required> -->
                                <p-calendar [inputStyle]="{'width':'326px'}" [(ngModel)]="dueDate" name="dueDate" dateFormat="yy-mm-dd" [showIcon]="true"></p-calendar>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label>路线
                                <span class="text-danger">*</span>
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="routingLine" [ngClass]="{'edited': order.routingLine}" [(ngModel)]="order.routingLine"
                                    required>
                            </div>
                        </div>
                    </div>
                    <div class="form-group form-md-line-input form-md-floating-label no-hint">
                        <label>任务备注</label>
                        <textarea class="form-control" type="text" name="remark" [ngClass]="{'edited': order.remark}" [(ngModel)]="order.remark"
                            rows="2"></textarea>
                    </div>
                    <div class="form-group form-md-line-input form-md-floating-label no-hint">
                        <label>车间备注</label>
                        <textarea class="form-control" type="text" name="workShopRemark" [ngClass]="{'edited': order.workShopRemark}" [(ngModel)]="order.workShopRemark"
                            rows="2"></textarea>
                    </div>
                </div>

                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{l("Cancel")}}</button>
                    <button type="submit" class="btn btn-primary blue" [disabled]="!editForm.form.valid" [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">
                        <i class="fa fa-save"></i>
                        <span>{{l("Save")}}</span>
                    </button>
                </div>

            </form>

        </div>
    </div>
</div>
